<template>
  <div class="article-manager">
    <div class="i-layout-page-header">
      <div class="i-layout-page-header">
        <div>
          <Tabs v-model="currentTab" @on-click="changeTab">
            <TabPane
              :label="item.label"
              :name="item.value.toString()"
              v-for="(item, index) in headerList"
              :key="index"
            />
          </Tabs>
        </div>
      </div>
    </div>
    <Card :bordered="false" dis-hover class="ivu-mt fromBox" v-if="currentIndex==0">
      
    </Card><!-- 排班设置 -->
  </div>
</template>

<script>
import formCreate from '@form-create/iview';
import request from '@/libs/request';
import { ListUserFinishedApi} from '@/api/register';
import { ListApi} from '@/api/mehistory';

export default {
  name: 'setting_setSystem',
  components: { formCreate: formCreate.$form() },
  data() {
    return {
      currentTab: '',
      headerList: [{
		  'label':'排班设置',
		  'value':0
	  },{
		  'label':'排班总览',
		  'value':1
	  }],
	  currentIndex:0
    };
  },
  created() {
    // this.getAllData();
	this.loadUserCheckList();
  },
  watch: {
    $route(to, from) {
      this.headerChildrenList = [];
      this.getAllData();
    },
    childrenId() {
      this.getFrom();
    },
  },
  methods: {
	  //获取预检记录 
	loadUserCheckList(){
		this.loading = true;
		ListUserFinishedApi({
		  page: this.page.pageNum,
		  limit: this.page.pageSize,
			uid:this.$route.params.id
		})
		  .then(async (res) => {
		    let data = res.data;
		    this.tableData = data.list;
		    this.page.total = data.count;
		    this.loading = false;
		  })
		  .catch((res) => {
		    this.loading = false;
		    this.$Message.error(res.msg);
		  });
	},
	  //获取即往病历记录 
	loadUserHistoryList(){
		this.loading2 = true;
		ListApi({
		  page: this.page2.pageNum,
		  limit: this.page2.pageSize,
			uid:this.$route.params.id
		})
		  .then(async (res) => {
		    let data = res.data;
		    this.tableData2 = data.list;
		    this.page2.total = data.count;
		    this.loading2 = false;
		  })
		  .catch((res) => {
		    this.loading2 = false;
		    this.$Message.error(res.msg);
		  });
	},
    // 头部tab
    getHeader(index) {
		
    },
    // 表单
    getFrom() {
      
    },
    async getAllData() {
		
    },
    // 选择
    changeTab(e) {
		this.currentIndex = e;
	  console.info(e);
    },
  },
};
</script>

<style scoped lang="stylus">
.ivu-tabs {
  margin-bottom: 18px;
}

.fromBox {
  min-height: 600px;
}
.header{
	display: flex
	flex-direction: row;
	justify-content:space-between;
}
.header .left{
	
}
.header .left .button{
	margin-right: 15px;
	width:80px;
}
.header .left .select{
	width: 200px;
}
.header .right{
	
}
.head{
	font-weight: bold;
	font-size: 18px;
	text-align: center
	padding: 20px 0px;
}
.container{
	display: flex;
	flex-direction: column;
}
table{
	border: 1px solid #f1f1f1;
	border-collapse: collapse;
}
table thead tr td{
	height:40px;
	background-color: #f7f7f7;
	padding: 0px 10px;
	font-weight: bold;
}
table tbody tr td{
	border: 1px solid #f1f1f1;
	border-collapse: collapse;
	text-align: center;
	width: 11%;
}
table .head{
	height: 73px;
	font-size: 14px;
}
table tbody tr{
	height: 40px;
}
.hand{
	cursor: pointer;
}
.week{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	padding: 0px 15px;
}
.week .left{
	display: flex;
	flex-direction: column;
}
.week .right{
	display: flex;
	flex-direction: row;
}
.week .right .add{
	display: inline-block;
	width: 15px;
	height:15px;
	border-radius: 7.5px;
	border: 1px solid #2d8cf0;
	line-height: 10px;
	color: #2d8cf0;
}
</style>
